/**
*	流程模块：扩展js
*	开发者：雨中磐石
*	地址：www.rockoa.com
*	日期：2023-07-20
*/



js.jxcbase_list = function(){
	
	
	this.initbodys = function(){
		this.optobj.addbtn('刷新库存','reloadstock', this);
		this.optobj.showleft('商品类型');
	}
	
	this.reloadstock = function(){
		var me = this;
		js.ajax.get({
			loading:'刷新中...',
			url:this.getacturl('reloadstock'),
			loadsuccess:'刷新成功'
		},function(ret){
			me.table.reload();
		});
	}
	
	this.onloadbefore = function(d){
		var me = this;
		if(d.typearr){
			importjs('tree','create', {
				data:d.typearr,
				firstid:d.typearr[0].pid,
				view:this.optobj.leftcontid(),
				openchliren:true,
				onitemclick:function(d){
					me.openpid(d.id);
				}
			});
		}
	}
	
	this.openpid = function(ids){
		this.table.setparams({typeid:ids}, true);
	}
}